<?php
/**
* All plugin classes must implement this interface.
*
* Copyright (c) 2009 James Gauld <james@jamesgauld.net>
* This file is part of Scribble.
* @license http://www.scribblecms.co.uk/license.txt
*
* @package Scribble
*/
interface IScribblePlugin {

	/**
	* Configure the plugin.
	*
	* This method should NOT include any environment-specific configuration as
	* that will be catered for in the configureEnvironment() method.
	* 
	*
	* @return void
	*/
	public function configure();

	/**
	* Configure some environment-specific settings.
	*
	* @param int Environment flag (see ScribbleEnvironment class)
	* @return void
	*/
	public function configureEnvironment($environment);

	/**
	* Return a URL which contains further information about this plugin.
	* Some useful things to include at this URL are:
	* - Instructions on how to go about upgrading the plugin
	* - Documentation or a wiki about how to use it
	*
	* @return string
	*/
	public function getInformationUrl();

	/**
	* Execute any required routines that will make this plugin work with the new
	* version of Scribble, specified by $to.
	*
	* If anything goes wrong, throw an Exception, otherwise it will be assumed
	* the patching process went without a hitch.
	*
	* @param string Version string (in the format "major.minor")
	* @param string Version string (in the format "major.minor")
	* @return void
	*/
	public function patchVersion($to, $from);

	/**
	* Run some tests to determine if this version of the plugin will still run ok
	* when the Scribble core is updated from version $from to version $to.
	*
	* Even if some patching is required to get the plugin working then return TRUE
	* as plugin patches will be applied during the upgrade process.
	*
	* It's not a good idea to assume the plugin will work with future versions so
	* only return results for versions of Scribble on which you've tested the
	* plugin.
	*
	* @param string Version string (in the format "major.minor")
	* @param string Version string (in the format "major.minor")
	* @return bool
	*/
	public function testVersionCompatibility($to, $from);
}
?>